import Vue from 'vue'
import Vuex from 'vuex'
import App from './App'
import VueResource from 'vue-resource'
import VueRouter from 'vue-router'
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-default/index.css'
// import jquery from 'jquery'
// import 'jquery/dist/jquery.js'

Vue.use(VueRouter)
Vue.use(ElementUI)
Vue.use(Vuex)
Vue.use(VueResource)
    // Vue.use(jquery)
import Main from './components/Main'
import Login from './components/Login'
import Costanalyse from './components/Costanalyse'
import Costmonthly from './components/Costmonthly'
const store = new Vuex.Store({
    state: {
        count: 0,
        isLogin: true,
        user: ''
    },
    mutations: {
        increment(state) {
            state.count++
        },
        changeLogin(state) {
            state.isLogin = !state.isLogin
        }
    }
})

const router = new VueRouter({
        routes: [{
            path: '/login',
            component: Login
        }, {
            path: '/',
            component: Main,
            children: [{
                path: '/costanalyse',
                component: Costanalyse
            }, {
                path: '/costmonthly',
                component: Costmonthly
            }]
        }]
    })
    /* eslint-disable no-new */
var vm = new Vue({
    el: '#app',
    router: router,
    store,
    template: '<App/>',
    components: { App }
})